<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['算法管理','标定系数[单车]']" icon="fa fa-subscript" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<div class="s_table">
		<h3 class="s_table_title"><span class="verticalLine">&nbsp;</span>标定系数[单车]</h3>
		<!--<div class="topAlgorithm">
			<div  class="algorithmTitle" >标定算法</div>
			<div  class="clearfix" style="min-width: 80%;display: inline-block;">
				<select  style="width: 100%;" class="form-control">
					<option value=''>散装水泥车标定算法</option>
				</select>
			</div>
		</div>-->
		<div class="page-header clearfix s_table_opreation">
			<div class="left page-header-btn">
				<sa-company-tree-car companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree-car>
				<div class="top_module">
					<span class="module_text">标定方式</span>
					<select class="module_inp" style="" [(ngModel)]="calibrationType">
						<option value="0101">散装水泥车[PQY]</option>
						<option value="0102">袋装水泥车[PQY]</option>
					</select>
				</div>
				<div class="top_module">
					<span class="module_text">地磅数据</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='weightCount' >
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
						<option value="11">11</option>
						<option value="12">12</option>
						<option value="13">13</option>
						<option value="14">14</option>
						<option value="15">15</option>
					</select>
					<span class="module_text" style="background: none;"><button class="lookbtn" (click)="weightRecord(weightRecordModal)"> 查看</button></span>
				</div>
				
				<div class="top_module form-group">
					<span class="module_text">时间区间 前[小时]：</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='beforeTime'>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
					</select>
				</div>
				
				<div class="top_module form-group">
					<span class="module_text">时间区间 后[小时]</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='afterTime'>
						<option value="0">0</option>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
						<option value="5">5</option>
						<option value="6">6</option>
						<option value="7">7</option>
						<option value="8">8</option>
						<option value="9">9</option>
						<option value="10">10</option>
					</select>
				</div>
				<button type="button" class="btn btn-primary" (click)="calculation()">计算</button>
				<button type="button" class="btn btn-primary" (click)="draw(drawModal)">绘图</button>
				<!--<div class="top_module form-group">
					<span class="module_text">时间间隔[秒]</span>
					<select name="" id="" class="top_module_select" [(ngModel)]='spaceTime'>
						<option value="1">1</option>
						<option value="2">2</option>
						<option value="3">3</option>
						<option value="4">4</option>
					</select>
				</div>-->
			</div>
		</div>
	</div>
	<!--表格头部操作部分end-->
	<div class="centerBody">
		<div>
			<div class="col-xs-12">
				<p class="topLabLine">
					<span class="topLabel">车牌号：</span><span>{{versionMessage.carNumber}}</span> 
					<span class="topLabel">版本号：</span><span>{{versionMessage.name}} </span>
					<span class="topLabel">车辆状态：</span>
					<span class="red" *ngIf="versionMessage.runStatus=='0'">离线</span>
					<span class="green" *ngIf="versionMessage.runStatus=='1'">在线</span>
					<span class="" *ngIf="versionMessage.runStatus!='1' && versionMessage.runStatus !='0'">{{versionMessage.runStatus}}</span>
				</p>
				
				<p class="topLabLine"><span class="topLabel">系数：</span> [ {{versionMessage.versionString}} ] </p>
			</div>
		</div>
		<div class="passageway" style="padding: 4px;">
			<div class="passTitle titleName">AD通道:</div>
			<div class="itemDiv" *ngFor="let item of ACH16;let i=index;"  onselectstart="return false">
				<div style="line-height: 24px;">
					<label class="checkbox-inline">
						<input class="checkbox style-0"  type="checkbox" [(ngModel)]="item.isChecked"  >
			            <span >ACH{{i+1}}</span>
			      	</label>
				</div>
			</div>
		</div>
		
		<div class="resultContent">
			<div class="row">
				<div class="col-md-3">
					<div class="resultItem"  *ngFor="let item of ACH16.slice(0,4);let i=index;" >
						<div>
							<span class="passName">Channel {{i+1}}</span>
							<input type="number"  class="form-control" [(ngModel)]="item.value" style="width:calc(100% - 84px);display: inline-block;"/>
						</div>
					</div>
				</div>
				<div class="col-md-3">
					<div class="resultItem"  *ngFor="let item of ACH16.slice(4,8);let i=index;" >
						<div>
							<span class="passName">Channel {{i+5}}</span>
							<input type="number"  class="form-control" [(ngModel)]="item.value" style="width:calc(100% - 84px);display: inline-block;"/>
						</div>
					</div>
				</div>
				<div class="col-md-3">
					<div class="resultItem"  *ngFor="let item of ACH16.slice(8,12);let i=index;" >
						<div>
							<span class="passName">Channel {{i+9}}</span>
							<input type="number"  class="form-control" [(ngModel)]="item.value" style="width:calc(100% - 84px);display: inline-block;"/>
						</div>
					</div>
				</div>
				<div class="col-md-3">
					<div class="resultItem"  *ngFor="let item of ACH16.slice(12,16);let i=index;" >
						<div>
							<span class="passName">Channel {{i+13}}</span>
							<input type="number"  class="form-control" [(ngModel)]="item.value" style="width:calc(100% - 84px);display: inline-block;"/>
						</div>
					</div>
				</div>
			</div>
		</div>
		
		<div class="resultExplain">
			<div class="titleName">结果说明</div>
			<textarea name="" id="" cols="30" rows="5" class="form-control" [(ngModel)]='resultExplain' placeholder="标定结果描述"></textarea>
		</div>
		
		<div class="bottomBtn" style="position: relative;">
			<button type="button" class="btn btn-primary" (click)="factorSetQueue()">保存系数</button>
			<div class="note" style="display:inline-block;position:absolute;margin-top:8px;left: 24px;">
				<p>注 :保存系数后，数据推到<span style="color: #1A6DDD;cursor: pointer;text-decoration: underline;" (click)="jumpFactorQueue()"> 系数设置队列</span></p>
			</div>
		</div>
	</div>
	
		<!-- 地磅弹窗-->
	<div bsModal #weightRecordModal="bs-modal" id="myModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="weightRecordModal.hide()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">地磅数据</h4>
				</div>
				<div class="modal-body">
					<div class="row">
						<form class="form form-inline " role="form">
							<div>
								<div class="table_scroll">
									<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
										<thead>
											<tr>
												<th>车牌号码</th>
												<th>过磅时间</th>
												<th>过磅重量</th>
											</tr>
										</thead>
										<tbody>
											<tr *ngFor="let row of loadometerData; let i = index">
												<td>{{row.carNumber}}</td>
												<td>{{row.date}}</td>
												<td>{{row.weight}}</td>
											</tr>
										</tbody>
									</table>
								</div>
							</div>
						</form>
					</div>
				</div>
				<!--<div class="modal-footer">
					<button type="button" class="btn btn-default" (click)="myModal.hide()">关闭</button>
				</div>-->
			</div>
		</div>
	</div>
	<!--地磅弹窗end-->
	
	<!-- 绘图弹出层 -->
	<div bsModal #drawModal="bs-modal" id="drawModal" class="modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg" style='min-width:1000px;margin-top:100px;'>
			<div class="modal-content">
				<div class="modal-header" style="padding: 0px 15px;">
					<button type="button" class="close" style="margin-top: 14px;" (click)="drawModal.hide()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<!-- <h4 class="modal-title">绘图数据</h4> -->
					<div class="widget-body no-padding" style="margin: 0;">
						<div class="page-header clearfix s_table_opreation" style="margin: 0;border:none;padding-bottom: 0;">
							<div class="left page-header-btn" style="padding: 5px;">
								<div class="top_module" style="min-width: 100px;">
									<span class="module_text" style="background: none;" >数据绘图</span>
								</div>
								<div class="top_module">
									<span class="module_text" style="background: none;" >{{versionMessage.carNumber}} [{{deviceId}}]</span>
								</div>
								<div style="display: inline-block;">
									<div>
										<div class="selectDate top_module">
											<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)" ></table-select-date>
										</div>
										<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
									</div>
								</div>
							</div>
						</div>
					</div>
					
				</div>
				<div class="modal-body">
					<div class="row">
						<!--折线图-->
						<div  style="background: white;border-radius: 5px;margin-top: 5px;position: relative;">
							<!-- <button (click)="closeChart()" class="div_closeBtn"> × </button> -->
							<!-- <div class="widget-body no-padding" style="margin: 0;">
								<div class="page-header clearfix s_table_opreation" style="margin: 0;">
									<div class="left page-header-btn" style="padding: 5px;">
										<div class="top_module">
											<span class="module_text" style="background: none;" >异常数据折线图</span>
										</div>
										<div style="display: inline-block;">
											<div>
												<div class="selectDate top_module">
													<table-select-date [notInit]='true' [specifyId]='specifyId' [specifyTime]='specifyTime' (outerTime)="getSelectChartTime($event)" ></table-select-date>
												</div>
												<button type="button" class="btn btn-primary" (click)="drawAbnormalChart()">查看</button>
											</div>
										</div>
									</div>
								</div>
							</div> -->
							
							<sa-chart-bmap  height='325' width="960" [inputParams]='selectedRow' [isBaiduMap]='true' (outerSend)="runParent($event)" (outerIsMap)='showMapView($event)' 
								[isAuditData]='false'	[isShowModify]='false'></sa-chart-bmap>
							<div [hidden]='!isMapView'>
								<sa-bmap-chart [trackParams]='drawTrackArr' height='300' [isShowBmap]='isMapView' deviceId="deviceId"></sa-bmap-chart>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	
</div>
